<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
include '../../operations/connection.php';	
include 'substring-comment.php';
$id = $_REQUEST['idproject'];

$prdelete = $_REQUEST['prdelete'];
$id_testproject = $_REQUEST['idtestproject'];
if ($prdelete==0){
				$sqlupdate = "UPDATE pr_testproject SET `Delete` = 1 WHERE IDTest = '$id_testproject'";
				mysql_query($sqlupdate);
			}else{
				$sqlcomment = "DELETE FROM pr_comment WHERE pr_comment.IDTestProject = '$id_testproject'";
				mysql_query($sqlcomment);
				
				$sqldelete = "DELETE FROM pr_testproject WHERE pr_testproject.IDTest = '$id_testproject'";
				mysql_query($sqldelete);
}

$id = $_REQUEST['idproject'];
$page = isset ( $_GET["page"] ) ? intval ( $_GET["page"] ) : 1;
mysql_close($connection);

header('Location: ../../project_admin.php?content=admin/project/project-detail.php&id='.$id."&tab=2&page=".$page);

?>